// Fractions
// UVa ID: 11251
// Verdict: Accepted
// Submission Date: 2017-07-26
// UVa Run Time: 0.000s
//
// 版权所有（C）2017，邱秋。metaphysis # yeah dot net

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);

    int B, N;
    map<string, string> trick = {
        {"3-2","1/2"}, {"4-2","3/12"}, {"4-3","3/21"}, {"6-4","45/312"},
        {"6-5","41/325"}, {"7-2","146/325"}, {"7-4","126/543"}, {"8-2","536/1274"},
        {"8-3","347/1265"}, {"8-4","275/1364"}, {"8-5","653/4127"}, {"8-6","567/4312"},
        {"8-7","421/3567"}, {"9-2","1568/3247"}, {"9-3","1378/4256"}, {"9-4","2154/8637"},
        {"9-5","1278/6534"}, {"9-6","1425/8763"}, {"10-2","7269/14538"}, {"10-3","5823/17469"},
        {"10-4","5796/23184"}, {"10-5","2769/13845"}, {"10-6","5697/34182"},
        {"10-7","5418/37926"}, {"10-8","6789/54312"}, {"10-9","6381/57429"},
        {"11-2","4263A/85179"}, {"11-4","1389A/54267"}, {"11-6","1329A/78645"},
        {"12-2","8329B/14657A"}, {"12-3","A516B/273489"}, {"12-4","5378A/1926B4"},
        {"12-5","94785/3AB261"}, {"12-6","3298B/174A56"}, {"12-7","AB129/645873"},
        {"12-8","2389B/165A74"}, {"12-9","6A24B/517983"}, {"12-10","789AB/654312"},
        {"12-11","9427B/86A531"}, {"13-2","3274AC/65198B"}, {"13-4","2746BC/A35189"},
        {"13-5","145ABC/693278"}, {"13-6","17642A/95BC38"}, {"13-8","1378BC/A29645"},
        {"13-9","12369C/A758B4"}, {"13-10","13249B/C5A876"}, {"14-3","62938B/147DAC5"},
        {"14-4","817BCD/246359A"}, {"14-5","74C5BD/28A6139"}, {"14-6","6341CD/295AB78"},
        {"14-8","7A2C8D/45B9316"}, {"14-9","A827CD/6B39145"}, {"14-10","B691CD/82A7534"},
        {"14-11","6AC29D/54781B3"}, {"14-12","89ABCD/7654312"}, {"14-13","846C9D/7A25B31"},
        {"15-2","15639BE/2AC748D"}, {"15-4","21496DE/8537CAB"}, {"15-6","1436CDE/7A5B289"},
        {"15-8","1246ACE/9358BD7"}, {"15-10","13D26AE/C8B9745"}, {"15-12","12D86A9/E4CB573"},
        {"16-2","9463ADF/128C75BE"}, {"16-3","734B8CF/159E2A6D"}, {"16-4","5298DEF/14A637BC"},
        {"16-5","9D478EF/31265CAB"}, {"16-6","7641DEF/2C58B39A"}, {"16-7","7AC4DEF/35B62189"},
        {"16-8","32B4DCF/195A6E78"}, {"16-9","2D5BCEF/1983A467"}, {"16-10","3AD9BEF/24C81756"},
        {"16-11","269DBEF/1A8C7345"}, {"16-12","6D78CEF/521A9B34"}, {"16-13","DA698EF/B175C423"},
        {"16-14","9ABCDEF/87654312"}, {"16-15","A6485CF/9BE3D721"}, {"17-2","4293BDEG/85176ACF"},
        {"17-3","3678BCFG/A25914DE"}, {"17-4","19A52EFG/6473B8CD"}, {"17-5","159842FG/6AD73EBC"},
        {"17-6","123C9EFG/6D5784AB"}, {"17-7","1467CEFG/8DB3529A"}, {"17-8","1D6B37FG/E524AC89"},
        {"17-9","146D9CFG/B5A32E78"}, {"17-10","158EB2FG/D43A9C67"}, {"17-11","138CA9FG/D4B2E756"},
        {"17-12","148C7AEG/F32D6B95"}, {"17-13","13AB9C6G/FD2E7854"}, {"17-14","124956DG/FECB7A83"},
        {"18-3","8379CDGH/16A4B25EF"}, {"18-4","A31786GH/24C5BF9DE"}, {"18-5","F1895EGH/4376AB2CD"},
        {"18-6","376DE9GH/1284AF5BC"}, {"18-7","4659DFGH/1C82E73AB"}, {"18-8","7862EFGH/35CD4B19A"},
        {"18-10","BD1A3EGH/694FC2578"}, {"18-11","3C985FGH/24BE1AD67"}, {"18-12","273CDFGH/1AE894B56"},
        {"18-13","BC1A3FGH/87D26E945"}, {"18-14","72C98EGH/5A1D6FB34"}, {"18-15","7E8CDFGH/6914BA523"},
        {"18-16","ABCDEFGH/987654312"}, {"18-17","A86C7BEH/9FG5D4321"}, {"19-2","2A4B7CDGI/5193F68EH"},
        {"19-4","2371C5GHI/8D96B4AEF"}, {"19-6","2841AF6HI/EB597G3CD"}, {"19-8","1365EFGHI/97C84D2AB"},
        {"19-10","1B254ADHI/FG3E7C689"}, {"19-12","13B8CGDHI/E5492AF67"}, {"19-14","139D68CHI/GB2FE7A45"},
        {"19-16","1247FEC8I/HGDB569A3"}, {"20-2","B4563EGHJ/128AC79DFI"}, {"20-3","9248AEBIJ/176D5C3FGH"},
        {"20-4","H1267DCIJ/38495AEBFG"}, {"20-5","D2761CHIJ/35BGA849EF"}, {"20-6","CA8461HIJ/3F295GB7DE"},
        {"20-7","81647FHIJ/2G93AEB5CD"}, {"20-8","DA7146HIJ/582G9EF3BC"}, {"20-9","DE872GHIJ/639F45C1AB"},
        {"20-10","345B6EHGJ/1C2FD78I9A"}, {"20-11","CHB42FGIJ/71D35AE689"}, {"20-12","61495GHIJ/3CEDBA2F78"},
        {"20-13","23G45BHIJ/189AFCED67"}, {"20-14","E91DF8HIJ/A273CG4B56"}, {"20-15","B3A6EGHIJ/87CF12D945"},
        {"20-16","FE186GHIJ/CB52D9A734"}, {"20-17","A1E7FDHIJ/8B94C6G523"}, {"20-18","BCDEFGHIJ/A987654312"},
        {"20-19","C6H49IDGJ/BEA758F321"}, {"21-2","62B3H4EFIK/C517D98AGJ"}, {"21-4","236E7BAIJK/8D5F941CGH"},
        {"21-5","1B29E4HIJK/7DC6835AFG"}, {"21-6","247BC1GIJK/D5369AH8EF"}, {"21-8","19F675AIJK/BEH8G234CD"},
        {"21-9","1A579FHIJK/D8643GE2BC"}, {"21-10","16G92E8FJK/D4H75I3CAB"}, {"21-12","162E5DCIJK/FAB34G7H89"},
        {"21-13","15DH26EIJK/GABC934F78"}, {"21-14","14E3CFGIJK/H298AB5D67"}, {"21-16","1298CGDAJK/HI3BFE6745"},
        {"21-17","125F97GBJK/IHDAC68E34"}, {"21-18","1247C8E6GK/JIFAD95HB3"}, {"22-2","C453I6FGJL/128A7ED9BHK"},
        {"22-3","A352BD4GKL/189F7CHE6IJ"}, {"22-4","8742C93JKL/1B6GA5EFDHI"}, {"22-5","52A9EFIJKL/13C847D6BGH"},
        {"22-6","4H258CIJKL/16EDA7B39FG"}, {"22-7","A29DB5GJKL/34H16CI87EF"}, {"22-8","3I946GHJKL/18F7CA2B5DE"},
        {"22-9","H916A5IJKL/72FBE48G3CD"}, {"22-10","A53G86IJKL/4E7F9H2D1BC"}, {"22-11","3456FCGJIL/1D2E7H89KAB"},
        {"22-12","8BCD15HIKL/4E6J2F3G79A"}, {"22-13","2B67FDIJKL/1AEGC543H89"}, {"22-14","I41G3HEJKL/BCD2695AF78"},
        {"22-15","293F8CHJKL/1E5BAIG4D67"}, {"22-16","27A3CEIJKL/1F98D4HGB56"}, {"22-17","278B6EIJKL/1HFCG3AD945"},
        {"22-18","E68DCGIJKL/BF5129HA734"}, {"22-19","B6CHDAIJKL/9GF14E87523"}, {"22-20","CDEFGHIJKL/BA987654312"},
        {"22-21","A5D86JBFIL/9H7GKCE4321"}, {"23-2","2C3H9DEFGKM/517BJ468AIL"}, {"23-4","41792C8FKLM/G56DA3BHEIJ"},
        {"23-6","231569DJKLM/CI78FBE4AGH"}, {"23-8","17J93CBIKLM/AGH4582D6EF"}, {"23-10","138E9GIJKLM/BAH6574F2CD"},
        {"23-12","1284KFEHJLM/D56CI3G79AB"}, {"23-14","17DBJ3AGKLM/IE54F2C6H89"}, {"23-16","14C5829HKLM/J3BGEFIAD67"},
        {"23-18","139D7IJEGLM/KFBA2H8C645"}, {"23-20","12457AIGHJM/LKFEB96DC83"}, {"24-2","E689A2DFHLN/14CGIK537BJM"},
        {"24-3","9562DAHCJMN/13FI7G84EBKL"}, {"24-4","D318A7GELMN/24C59H6IBFJK"}, {"24-5","B3AF6EGKLMN/27H5491C8DIJ"},
        {"24-6","D21F7A8GLMN/36C9JKE45BHI"}, {"24-7","BJ147FIKLMN/3AD865EC29GH"}, {"24-8","6CA15BHDIMN/24389JLKE7FG"},
        {"24-9","68C3AKHJLMN/294D71IGB5EF"}, {"24-10","I82CB5JKLMN/7F914GA6H3DE"}, {"24-11","FG5983JKLMN/74AB6HI2E1CD"},
        {"24-12","3458DAFIJKN/1E2G6H7L9MBC"}, {"24-13","6F4H7CGJKMN/3E5D91L2I8AB"}, {"24-14","612D5I7KLMN/3CFBH8GE4J9A"},
        {"24-15","473DFEJKLMN/2GB5CI6A1H89"}, {"24-16","E4G1K3IJLMN/9B2H5ACD6F78"}, {"24-17","HA21GEFKLMN/C83B4I95JD67"},
        {"24-18","JC9DAHIKLMN/EF742183GB56"}, {"24-19","I6ACGJHKLMN/EB2817F3D945"}, {"24-20","F2B5H6JKLMN/CE18I9GDA734"},
        {"24-21","FA8IBHJKLMN/DC1G46E97523"}, {"24-22","DEFGHIJKLMN/CBA987654312"}, {"24-23","C9E8G5FMHKN/BL4I7DA6J321"},
        {"25-2","265D7E9GHLMO/4CB1F3J8AIKN"}, {"25-3","52B4H3DIJKNO/F78E1AG69CLM"}, {"25-4","1F982H3DJMNO/6BC7AIE54GKL"},
        {"25-5","15BC3GHFLMNO/627AI8D49EJK"}, {"25-6","193B2DAHLMNO/84KGF5E76CIJ"}, {"25-8","1D3B6L7EJMNO/C52F4KAI98GH"},
        {"25-9","195LBEHJKMNO/C82I47A3D6FG"}, {"25-10","15G3AHIKLMNO/C6B972D8J4EF"}, {"25-11","1A5389JKLMNO/FC6BH7I4G2DE"},
        {"25-12","1HAM8F4GLJNO/K95I3762BECD"}, {"25-13","1357D2FHJLNO/EGIMK9468ABC"}, {"25-14","1465F7IJKMNO/G9C3E8D2HLAB"},
        {"25-16","17EB5GC3IMNO/KL64FDJA2H89"}, {"25-17","12BE63DJKMNO/IGLH4A9C5F78"}, {"25-18","13HBFA54LMNO/KGE928ICJD67"},
        {"25-19","128D9FAHLMNO/KJC47I3EGB56"}, {"25-20","123C6FAEGMNO/LHJK78BID945"}, {"25-21","1256C8HDJKNO/MLAB97IEGF34"},
        {"25-22","124657HFAKLO/NMIBGJCED983"}, {"26-2","I46B2EGHJKNP/1A8CM5379DFLO"}, {"26-3","E3462BF5KLOP/1G9CI78JHADMN"},
        {"26-4","G3894EFJKNOP/2CD7AI6B15HLM"}, {"26-5","H92B5D6IMNOP/38JC41E7GAFKL"}, {"26-6","I9EAF2HLMNOP/4658BCG317DJK"},
        {"26-7","52CF8D6KMNOP/19HA37ELG4BIJ"}, {"26-8","BGE74KDLMNOP/3F2A5C86J19HI"}, {"26-9","CBIA3EJKLNOP/4819D62M5F7GH"},
        {"26-10","AJ9218EIMNOP/43BCKD7H6L5FG"}, {"26-11","B859GHJLMNOP/4KC721DA6I3EF"}, {"26-12","JKC75I4LMNOP/93BH8GA62F1DE"},
        {"26-13","2B46EHGJNIKP/15F378L9OMACD"}, {"26-14","5N8F7DIJLMOP/34EG61A2HK9BC"}, {"26-15","479HEJGKMNOP/2C6F3D8I15LAB"},
        {"26-16","5KD6FI8LMNOP/3EG41H7BC2J9A"}, {"26-17","3KD456EMGNOP/2CAFJB7IL1H89"}, {"26-18","D35MGIAKLNOP/9261HEJCB4F78"},
        {"26-19","4HECB9GIMNOP/3ALF2815KJD67"}, {"26-20","4EJ79FIKMNOP/3D8LHA2C1GB56"}, {"26-21","IGB82KALMNOP/F173E6CJHD945"},
        {"26-22","H1CI2FKLMNOP/EB6J859GDA734"}, {"26-23","F8A6CGILMNOP/DEB1J4KH97523"}, {"26-24","EFGHIJKLMNOP/DCBA987654312"},
        {"26-25","G4CN6KBIOJMP/FE8A9DH75L321"}, {"27-2","135798KBFJLOQ/26AEIHDN4CGMP"}, {"27-4","3198HBEGKLOPQ/C5A7FJ4D26IMN"},
        {"27-6","3156GAFJMNOPQ/I74CH9DB28EKL"}, {"27-8","15CH7EF4MNOPQ/9GK368DBL2AIJ"}, {"27-10","1E9AB75KLMOPQ/F8CN4I3J2D6GH"},
        {"27-12","137GBIKLMNOPQ/DCA8596J4H2EF"}, {"27-14","1246AIGOJLNPQ/F358EHKM79BCD"}, {"27-16","163E7G8KMNOPQ/JH2CDI59F4LAB"},
        {"27-18","12E3K4NALMOPQ/JIBDC6G5F7H89"}, {"27-20","125MA9GKCNOPQ/LH8FI3B4EJD67"}, {"27-22","1238AEBHCGOPQ/NJIMFKD67L945"},
        {"27-24","12457ALHBKMNQ/POJIFG6DCE983"}
    };
    
    while (cin >> B >> N, B > 0)
    {
        string indexer = to_string(B) + "-" + to_string(N);
        cout << B << ' ' << N << ' ' << trick[indexer] << '\n';
    }
    
    return 0;
}
